
import {
    TEXT
} from '@/conf/uiTypes';
import Vue from 'vue';

//性别
export const sexOptions = [
    { value: "man", label: "男" },
    { value: "woman", label: "女" }
];
export const genEditForm = function (row) {
    // this:Vue
    let filter = Vue.filter.bind(Vue);
    return {
        items: [
            [{ label: 'id', value: row.id, key: 'id', }],
            [{ label: '姓名', value: row.name, key: 'name', }],
            [{ label: '出生日期', value: filter('birthday')(row.birthday), key: 'birthday' }],
            [{ label: '性别', value: filter('sex')(row.sex), key: 'sex' }],
            [{ label: '教育程度', value: filter('education')(row.education), key: 'education' }],
            [{ label: '地址', value: row.address1, key: 'address1' }],
            [{ label: '手机号', value: row.mobile_phone, key: 'mobile_phone' }],
            [{ label: '身份证', value: row.identity_card, key: 'identity_card' }],
        ].map((arr) => {
            arr[0].type = TEXT;
            arr[0].attrs = {
                disabled: true
            }
            arr[0].colspan = 22;
            return arr;
        }),
    }
}
export const tableConf = Object.freeze({});
export const columns = Object.freeze([
    {
        prop: 'birthday',
        label: '出生日期',
        width: 120,
    },
    {
        prop: 'name',
        label: '姓名',
        width: 120,
    },
    {
        label: '身份证',
        prop: 'identity_card',

    },
    {
        label: '操作',
        prop: 'operation',
        width: 300,
    },
].map(ele => ({ ...ele, align: 'center' })));